package com.liao.badminton.dto;

import com.liao.badminton.code.BaseField;
import com.liao.badminton.code.validation.Delete;
import com.liao.badminton.code.validation.Insert;
import com.liao.badminton.code.validation.Update;
import io.swagger.annotations.ApiModelProperty;
import com.liao.badminton.entity.SystemLoginLog;
import javax.validation.constraints.NotNull;
import java.util.List;
import lombok.Data;
import com.liao.badminton.code.validation.FindDetail;
import java.lang.String;
import java.util.Date;

/**
* @author liaocheng
* @date 2024-12-23
* description:用户登录日志
*/
@Data
public class SystemLoginLogDto extends BaseField {

    @ApiModelProperty(value = "id")
    @NotNull(message = "主键id不能为空",groups = {Update.class, FindDetail.class})
    private Long id;

    @ApiModelProperty(value = "用户id")
    private Long userId;

    @ApiModelProperty(value = "登录IP")
    private String loginIp;

    @ApiModelProperty(value = "登录类型1一键登录2密码登录3微信4微博5QQ6缓存登录")
    private Integer loginType;

    @ApiModelProperty(value = "登录设备1web,2android,3ios,4h5,5其他")
    private String loginSource;

    @NotNull(message = "主键id不能为空",groups = {Delete.class})
    private List<Long> delIds;  //批量删除ids

    public SystemLoginLog invertEntity(){
        SystemLoginLog dto = new SystemLoginLog();
        BaseField.invert(this, dto);
        dto.setId(this.getId());
        dto.setUserId(this.getUserId());
        dto.setLoginIp(this.getLoginIp());
        dto.setLoginType(this.getLoginType());
        dto.setLoginSource(this.getLoginSource());
        return dto;
    }
}
